import { Route, Routes } from "react-router-dom";

import IndexPage from "@/pages/index";
import DocsPage from "@/pages/docs";
import PricingPage from "@/pages/pricing";
import BlogPage from "@/pages/blog";
import AboutPage from "@/pages/about";
import LoginPage from "@/pages/login";
import RegisterPage from "@/pages/register";
import LogoutPage from "@/pages/logout";
import VehicleLocationPage from "@/pages/vehicle-location";
import WorkDataPage from "@/pages/work-data";
import WorkDetailPage from "@/pages/work-detail";
import VehicleListPage from "@/pages/vehicle-list";
import VehicleTeamPage from "@/pages/vehicle-team";
import DriverListPage from "@/pages/driver-list";
import ProtectedRoute from "@/components/ProtectedRoute";

// Template pages
import ChartPage from "@/pages/template/chart";
import ConsolePage from "@/pages/template/console";
import AnalysisPage from "@/pages/template/analysis";
import ECommercePage from "@/pages/template/e-commerce";
import TemplatePricingPage from "@/pages/template/pricing";
import ChatPage from "@/pages/template/chat";
import TablePage from "@/pages/template/table";

function App() {
  return (
    <Routes>
      <Route element={<ProtectedRoute><IndexPage /></ProtectedRoute>} path="/" />
      <Route element={<ProtectedRoute><VehicleLocationPage /></ProtectedRoute>} path="/vehicle-location" />
      <Route element={<ProtectedRoute><WorkDataPage /></ProtectedRoute>} path="/work-data" />
      <Route element={<ProtectedRoute><WorkDetailPage /></ProtectedRoute>} path="/work-detail" />
      <Route element={<ProtectedRoute><VehicleListPage /></ProtectedRoute>} path="/vehicle-list" />
      <Route element={<ProtectedRoute><VehicleTeamPage /></ProtectedRoute>} path="/vehicle-team" />
      <Route element={<ProtectedRoute><DriverListPage /></ProtectedRoute>} path="/driver-list" />
      <Route element={<ProtectedRoute><ChartPage /></ProtectedRoute>} path="/template/chart" />
      <Route element={<ProtectedRoute><ConsolePage /></ProtectedRoute>} path="/template/console" />
      <Route element={<ProtectedRoute><AnalysisPage /></ProtectedRoute>} path="/template/analysis" />
      <Route element={<ProtectedRoute><ECommercePage /></ProtectedRoute>} path="/template/e-commerce" />
      <Route element={<ProtectedRoute><TemplatePricingPage /></ProtectedRoute>} path="/template/pricing" />
      <Route element={<ProtectedRoute><ChatPage /></ProtectedRoute>} path="/template/chat" />
      <Route element={<ProtectedRoute><TablePage /></ProtectedRoute>} path="/template/table" />
      <Route element={<DocsPage />} path="/docs" />
      <Route element={<PricingPage />} path="/pricing" />
      <Route element={<BlogPage />} path="/blog" />
      <Route element={<AboutPage />} path="/about" />
      <Route element={<LoginPage />} path="/login" />
      <Route element={<RegisterPage />} path="/register" />
      <Route element={<LogoutPage />} path="/logout" />
    </Routes>
  );
}

export default App;